/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import Util.GuiUtil;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author Nguyen Hong Phu (1142066) - 11HCB (HCMUS)
 */
public class MainGUI extends javax.swing.JFrame {

    /**
     * Creates new form MainGUI
     */
    public MainGUI() {
        initComponents();
         try
        {            
            this.setContentPane(jDesktopPane);
            this.setExtendedState(JFrame.MAXIMIZED_BOTH);
        }
        catch(Exception ex)
        {
            JOptionPane.showMessageDialog(this, "Error: " + ex.getMessage(), "Notice", JOptionPane.OK_OPTION);
        }
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane = new javax.swing.JDesktopPane();
        jMenuBar2 = new javax.swing.JMenuBar();
        jMenuQuanLy = new javax.swing.JMenu();
        jMenuItemOptions = new javax.swing.JMenuItem();
        jMenuItemInvoice = new javax.swing.JMenuItem();
        jMenuItemInvoiceSearch = new javax.swing.JMenuItem();
        jMenuItemReceipts = new javax.swing.JMenuItem();
        jMenuItemCustomer = new javax.swing.JMenuItem();
        jMenuKhoHang = new javax.swing.JMenu();
        jMenuItemProductCat = new javax.swing.JMenuItem();
        jMenuItemProduct = new javax.swing.JMenuItem();
        jMenuItemWarehoseManager = new javax.swing.JMenuItem();
        jMenuItemWarehouseSearch = new javax.swing.JMenuItem();
        jMenuSale = new javax.swing.JMenu();
        jMenuItemStatusSale = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jDesktopPane.setBackground(new java.awt.Color(204, 204, 204));

        jMenuQuanLy.setText("Quản lý");

        jMenuItemOptions.setText("Quy định");
        jMenuItemOptions.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemOptionsActionPerformed(evt);
            }
        });
        jMenuQuanLy.add(jMenuItemOptions);

        jMenuItemInvoice.setText("Hóa đơn");
        jMenuItemInvoice.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemInvoiceActionPerformed(evt);
            }
        });
        jMenuQuanLy.add(jMenuItemInvoice);

        jMenuItemInvoiceSearch.setText("Tìm kiếm hóa đơn");
        jMenuItemInvoiceSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemInvoiceSearchActionPerformed(evt);
            }
        });
        jMenuQuanLy.add(jMenuItemInvoiceSearch);

        jMenuItemReceipts.setText("Phiếu thu");
        jMenuItemReceipts.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemReceiptsActionPerformed(evt);
            }
        });
        jMenuQuanLy.add(jMenuItemReceipts);

        jMenuItemCustomer.setText("Khách hàng");
        jMenuItemCustomer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemCustomerActionPerformed(evt);
            }
        });
        jMenuQuanLy.add(jMenuItemCustomer);

        jMenuBar2.add(jMenuQuanLy);

        jMenuKhoHang.setText("Kho hàng");
        jMenuKhoHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuKhoHangActionPerformed(evt);
            }
        });

        jMenuItemProductCat.setText("Danh mục sản phẩm");
        jMenuItemProductCat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemProductCatActionPerformed(evt);
            }
        });
        jMenuKhoHang.add(jMenuItemProductCat);

        jMenuItemProduct.setText("Sản phẩm");
        jMenuItemProduct.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemProductActionPerformed(evt);
            }
        });
        jMenuKhoHang.add(jMenuItemProduct);

        jMenuItemWarehoseManager.setText("Phiếu nhập kho");
        jMenuItemWarehoseManager.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemWarehoseManagerActionPerformed(evt);
            }
        });
        jMenuKhoHang.add(jMenuItemWarehoseManager);

        jMenuItemWarehouseSearch.setText("Tìm kiếm phiếu nhập kho");
        jMenuItemWarehouseSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemWarehouseSearchActionPerformed(evt);
            }
        });
        jMenuKhoHang.add(jMenuItemWarehouseSearch);

        jMenuBar2.add(jMenuKhoHang);

        jMenuSale.setText("Bán hàng");

        jMenuItemStatusSale.setText("Tình trạng bán hàng");
        jMenuItemStatusSale.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemStatusSaleActionPerformed(evt);
            }
        });
        jMenuSale.add(jMenuItemStatusSale);

        jMenuBar2.add(jMenuSale);

        jMenu1.setText("Test");

        jMenuItem1.setText("jMenuItem1");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar2.add(jMenu1);

        setJMenuBar(jMenuBar2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jDesktopPane, javax.swing.GroupLayout.PREFERRED_SIZE, 637, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jDesktopPane, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemProductActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemProductActionPerformed
       GuiUtil.addInternalFrame(jDesktopPane, FrmProduct.class);
    }//GEN-LAST:event_jMenuItemProductActionPerformed

    private void jMenuItemOptionsActionPerformed(java.awt.event.ActionEvent evt) {                                           
        GuiUtil.addInternalFrame(jDesktopPane, FrmOptions.class);
    }
    
    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        GuiUtil.addInternalFrame(jDesktopPane, FrmDemo.class);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItemProductCatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemProductCatActionPerformed
         GuiUtil.addInternalFrame(jDesktopPane, FrmProductCat.class);
    }//GEN-LAST:event_jMenuItemProductCatActionPerformed

    private void jMenuItemWarehouseSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemWarehouseSearchActionPerformed
          GuiUtil.addInternalFrame(jDesktopPane, FrmWarehouseSearch.class);
    }//GEN-LAST:event_jMenuItemWarehouseSearchActionPerformed

    private void jMenuItemWarehoseManagerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemWarehoseManagerActionPerformed
        GuiUtil.addInternalFrame(jDesktopPane, FrmWarehouse.class);
    }//GEN-LAST:event_jMenuItemWarehoseManagerActionPerformed

    private void jMenuKhoHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuKhoHangActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuKhoHangActionPerformed

    private void jMenuItemInvoiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemInvoiceActionPerformed
        GuiUtil.addInternalFrame(jDesktopPane, FrmInvoice.class);
    }//GEN-LAST:event_jMenuItemInvoiceActionPerformed

    private void jMenuItemReceiptsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReceiptsActionPerformed
        GuiUtil.addInternalFrame(jDesktopPane, FrmReceipts.class);
    }//GEN-LAST:event_jMenuItemReceiptsActionPerformed

    private void jMenuItemInvoiceSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemInvoiceSearchActionPerformed
        GuiUtil.addInternalFrame(jDesktopPane, FrmInvoiceSearch.class);
    }//GEN-LAST:event_jMenuItemInvoiceSearchActionPerformed

    private void jMenuItemCustomerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCustomerActionPerformed
         GuiUtil.addInternalFrame(jDesktopPane, FrmCustomer.class);
    }//GEN-LAST:event_jMenuItemCustomerActionPerformed

    private void jMenuItemStatusSaleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemStatusSaleActionPerformed
         GuiUtil.addInternalFrame(jDesktopPane, FrmStatusSale.class);
    }//GEN-LAST:event_jMenuItemStatusSaleActionPerformed
   
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane jDesktopPane;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar2;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItemCustomer;
    private javax.swing.JMenuItem jMenuItemInvoice;
    private javax.swing.JMenuItem jMenuItemInvoiceSearch;
    private javax.swing.JMenuItem jMenuItemOptions;
    private javax.swing.JMenuItem jMenuItemProduct;
    private javax.swing.JMenuItem jMenuItemProductCat;
    private javax.swing.JMenuItem jMenuItemReceipts;
    private javax.swing.JMenuItem jMenuItemStatusSale;
    private javax.swing.JMenuItem jMenuItemWarehoseManager;
    private javax.swing.JMenuItem jMenuItemWarehouseSearch;
    private javax.swing.JMenu jMenuKhoHang;
    private javax.swing.JMenu jMenuQuanLy;
    private javax.swing.JMenu jMenuSale;
    // End of variables declaration//GEN-END:variables
}
